package com.shop.loan.model;

import lombok.Getter;
import lombok.Setter;
import xyz.erupt.annotation.Erupt;
import xyz.erupt.annotation.EruptField;
import xyz.erupt.annotation.sub_field.Edit;
import xyz.erupt.annotation.sub_field.View;
import xyz.erupt.upms.helper.HyperModelCreatorVo;

import javax.persistence.*;
import java.math.BigDecimal;


@Setter
@Getter
@Erupt(
        name = "产品列表"
)
@Table(name = "s_product")
@Entity
public class Product extends HyperModelCreatorVo {


    @EruptField(
            views = @View(title = "名称"),
            edit = @Edit(title = "名称", notNull = true)
    )
    private String name;

    @EruptField(
            views = @View(title = "金额",width = "100px"),
            edit = @Edit(title = "金额", notNull = true)
    )
    private BigDecimal money;


    @EruptField(
            views = @View(title = "借款天数"),
            edit = @Edit(
                    title = "借款天数",
                    notNull = true
            )
    )
    private Integer loanDay = 30;


    @EruptField(
            views = @View(title = "借款期数"),
            edit = @Edit(
                    title = "借款期数",
                    notNull = true
            )
    )
    private Integer loanPeriod = 2;

    @EruptField(
            views = @View(title = "年化利率(%)"),
            edit = @Edit(
                    title = "年化利率(%)",
                    notNull = true
            )
    )
    private BigDecimal yearRate = BigDecimal.valueOf(23);

}
